package com.meixiang.entity.shopping;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 套装商品中的商品信息
 *
 * @author LZRUI
 */
public class GoodsSpecEntity implements Parcelable {

    private String goodsId; // 商品id
    private String goodsSpecId; // id
    private String goodsName; // 商品名称
    private String goodsImage; // 商品图片

    public GoodsSpecEntity(String goodsId, String goodsSpecId, String goodsName, String goodsImage) {
        this.goodsId = goodsId;
        this.goodsSpecId = goodsSpecId;
        this.goodsName = goodsName;
        this.goodsImage = goodsImage;
    }

    public GoodsSpecEntity() {

    }

    public String getGoodsId() {
        return goodsId== null ? "" :goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsSpecId() {
        return goodsSpecId== null ? "" :goodsSpecId;
    }

    public void setGoodsSpecId(String goodsSpecId) {
        this.goodsSpecId = goodsSpecId;
    }

    public String getGoodsName() {
        return goodsName == null ? "" : goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsImage() {
        return goodsImage == null ? "" : goodsImage;
    }

    public void setGoodsImage(String goodsImage) {
        this.goodsImage = goodsImage;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.goodsId);
        dest.writeString(this.goodsSpecId);
        dest.writeString(this.goodsName);
        dest.writeString(this.goodsImage);
    }

    protected GoodsSpecEntity(Parcel in) {
        this.goodsId = in.readString();
        this.goodsSpecId = in.readString();
        this.goodsName = in.readString();
        this.goodsImage = in.readString();
    }

    public static final Creator<GoodsSpecEntity> CREATOR = new Creator<GoodsSpecEntity>() {
        @Override
        public GoodsSpecEntity createFromParcel(Parcel source) {
            return new GoodsSpecEntity(source);
        }

        @Override
        public GoodsSpecEntity[] newArray(int size) {
            return new GoodsSpecEntity[size];
        }
    };
}
